home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / util / time / Mayland.lha / MaylandV1.0 / Rexx / ImportFromDFA.Rexx < prev    next >
OS/2 REXX Batch file  |  1996-08-17  |  885b  |  41 lines

  1. /* Import birthdays from DFAddress.
  2.  
  3. The birthdays should be either:
  4.  
  5.     DD/MM-YY    or
  6.     DD/MM-YYYY
  7.                                     */
  8.  
  9. Options FailAt 21
  10. Options Results
  11.  
  12. If Show(Ports,'DFA') = 0 Then
  13. Do;Say "Start DFA first.";Exit;End
  14.  
  15. If Show(Ports,'MaylandRexx') = 0 Then
  16. Do;Say "Start Mayland first.";Exit;End
  17.  
  18. Address 'DFA' First Stem P.
  19. Added = 0 ; Failed = 0
  20.  
  21. Do While RC = 0
  22.  
  23.  First = P.Address.1
  24.  Name  = P.Address.2
  25.  Birth = P.Address.9
  26.  
  27.  If Birth ~= "" Then Do
  28.   Parse Var Birth Date '/' Month '-' Year
  29.   If Year < 1900 Then Year = Year + 1900
  30.   Msg = '"Idag fylder' First Name '%y-'Year' år"'
  31.   Address 'MaylandRexx' AddDate Date Month 0 12 00 Before 5*24*60 After 30*24*60 Message Msg
  32.   If RC = 0 Then Added = Added + 1
  33.   Else Failed = Failed + 1
  34.  End
  35.  
  36.  Address 'DFA' Next Stem P.
  37. End
  38.  
  39. Say "I've succesfully added" Added "birthday-event(s)," Failed "failed!"
  40. Exit
  41.